Page({
  data:{
    huoDongimageUrl:'http://weixin.siyanli.net.cn/static/miniimg/guize-01.png',
    headImageUrl:'',      
    ruleDesImageUrl:'',
    ruleDesImageHidden:true,
    duiHuanPopViewHidden:true,
    items: [{
      ID:"1",
      ProductName: "2",
      Point: 35
    },{
      ID:"1",
      ProductName: "2",
      Point: 35
    },{
      ID:"1",
      ProductName: "2",
      Point: 35
    }], // 数据列表
    points:'',//积分数
    activity:{},//头试图信息
    color:'',//立即兑换按钮颜色
    cell:{},//每个cell
    userInfo: {},
    hasUserInfo: false,
    //判断小程序的API，回调，参数，组件等是否在当前版本可用。
    canIUse: wx.canIUse('button.open-type.getUserInfo')
  },
  onSuccess: function (res) { //onSuccess回调
    wx.hideLoading();
    console.log(res);

    if (res.stateCode != 100){
    
      console.log(res.message);
      this.show({
        iconToast: '', // 对：icon-dui, 错：icon-cuo,警告：icon-warning
        imageToast:'',
        textToast: res.message,
        duration:100,
      })
     if(res.stateCode == 110){
       wx.redirectTo({
         url: '../phone/phone',
       })
     }
    }else {
      this.setData({
        items: res.data.ActivityProduct, //请求结果数据
        activity: res.data.activity,
        points: res.data.Points
      })
    }
  
  },
})